package com.bw.controller;

import com.bw.entity.Roleadm;
import com.bw.entity.TbUser;
import com.bw.service.PortService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
public class PortController {

    @Autowired
    private PortService studentService;

    @PostMapping("login")
    TbUser login(@RequestBody TbUser tbUser){
        return studentService.login(tbUser);
    }
   @RequestMapping("portlist")
    public List portlist(@RequestParam("mohu")String mohu){
       return studentService.portlist(mohu);
  }
    @RequestMapping("rolelist")
    List rolelist(@RequestParam("mohu") String mohu){
        return this.studentService.rolelist(mohu);
    }
    @RequestMapping("admadds")
    public Roleadm admadds(@RequestBody Roleadm roleadm){
        return this.studentService.admadds(roleadm);
    }
    @RequestMapping("admdel")
    public String[] del(@RequestParam("id") String id){
        return this.studentService.del(id);
    }
    @RequestMapping("findByadma")
    public Roleadm findByadma(@RequestParam("id") int id){
        return this.studentService.findByadma(id);
    }
    //修改
    @RequestMapping("updateByadmaKey")
    public void updateByadmaKey(@RequestBody Roleadm adma){
            this.studentService.updateByadmaKey(adma);
    }
    //列表详情
    @RequestMapping("portcontext")
    public List portcontext(@RequestParam("qxqid") int qxqid){
        return this.studentService.portcontext(qxqid);
    }
    @RequestMapping("rcport")//入参列表
    List rcport(@RequestParam("rcid")int rcid,@RequestParam("pdid") int pdid){
        return this.studentService.rcport(rcid,pdid);
    }
    @RequestMapping("ccport")//出参列表
    List ccport(@RequestParam("ccid")int ccid,@RequestParam("pdid") int pdid){
        return this.studentService.ccport(ccid,pdid);
    }

    @RequestMapping("requesthead")//请求头
    List requesthead(@RequestParam("shicid") int shicid,@RequestParam("interid") int interid){
        return this.studentService.requesthead(shicid,interid);
    }
    @RequestMapping("requestbody")//请求参数
    List requestbody(@RequestParam("shicid")int shicid,@RequestParam("interid") int interid){
        return this.studentService.requestbody(shicid,interid);
    }
    @RequestMapping("Successorfailure")
    List Successorfailure(){
        return this.studentService.Successorfailure();
    }
}
